<?php
 require_once('includes/common.php');
  require_once('includes/header.php');

  $id = isset($_GET['id'])?$_GET['id']:0;
  if($id == 0){
  $id = isset($_SESSION['id'])?$_SESSION['id']:0;
  }
  $selectQuery = "SELECT * FROM `users` WHERE `id`=$id";
  $selectResult = mysql_query($selectQuery)or die('Unable to select Data'.mysql_error());

  $user = mysql_fetch_assoc($selectResult);
?>



   <table border="1" cellpadding="0" cellspacing="0" width="50%" align="center" class="table table-striped">
    <thead>
   <tr>
    <th>My details are</th>
    <th style="text-align: right;"><a href="edit_profile.php?id=<?=$user['id']?>">Edit</a></th>
   </tr>
  </thead>
  <tbody>
   <tr>
    <td align="right" width="40">Name :</td>
    <td width="60"><?=$user['name']?></td>
   </tr>

   <tr>
    <td align="right">E-mail :</td>
    <td><?=$user['email']?></td>
   </tr>

   <tr>
    <td align="right">Gender :</td>
    <td>
    <?=getGender($user['gender'])?>
    </td>
   </tr>
   <tr>
    <td align="right">Address :</td>
    <td><?=$user['address']?></td>
   </tr>
   <tr>
    <td align="right">Country :</td>
    <td><?=getCountries($user['country'])?>
    </select>
    </td>
   </tr>
   <tr>
    <td align="right">Languages Known :</td>
    <td><?=$user['lang']?>
    </td>
   </tr>
   <tr>
    <td align="right">Hobbies :</td>
    <td><?=$user['hobbies']?>
    </td>
   </tr>
   <tr>
    <td align="right">Avatar :</td>
    <td><img src="uploads/<?=$user['avatar']?>" height="90" width="120"></td>
   </tr>

   <tr>
    <td align="right">Status :</td>
    <td><?=getStatus($user['status'])?></td>
   </tr>
    </tbody>
   </table>
  </form>
 </body>


</html>

